import Vue from 'vue'
import VueRouter from 'vue-router'
// 路由懒加载
// const login = () => import('@/views/login')
Vue.use(VueRouter)

const routes = [
  // 登录页路由
  {
    path: '/login',
    // component: login
    component: () => import('@/views/login')
  },
  // layout页路由
  {
    path: '/',
    component: () => import('@/views/layout'),
    redirect: '/home',
    children: [
      {
        path: '/home',
        component: () => import('@/views/home')
      },
      {
        path: '/qa',
        component: () => import('@/views/qa')
      },
      {
        path: '/video',
        component: () => import('@/views/video')
      },
      {
        path: '/my',
        component: () => import('@/views/my')
      }
    ]
  }
]

const router = new VueRouter({
  routes
})

export default router
